using System.Collections.Generic;

namespace OffsetPath
{
    public class ClassZ
    {
        private ClassN a;
        private bool b;
        private Dictionary<ClassN, bool> c = new Dictionary<ClassN, bool>();
        private Dictionary<ClassF, bool> d = new Dictionary<ClassF, bool>();
        private bool e;

        public IEnumerable<ClassF> MethodA()
        {
            return this.d.Keys;
        }

        public void MethodA(ClassF A_0)
        {
            this.d[A_0] = true;
        }

        public void MethodA(ClassN A_0)
        {
            this.c[A_0] = true;
        }

        public void MethodA(ClassZ A_0)
        {
            if (this.a == null)
            {
                this.a = A_0.a;
                this.b = A_0.b;
            }
            else if (A_0.a != null)
            {
                throw new CustomException("Border polygon group can not be merged.");
            }
            foreach (ClassN n in A_0.MethodB())
            {
                this.MethodA(n);
            }
            foreach (ClassF f in A_0.MethodA())
            {
                this.MethodA(f);
                f.MethodA(this);
            }
            A_0.e = true;
        }

        public void MethodA(ClassN A_0, bool A_1)
        {
            if ((this.a != null) && (this.a != A_0))
            {
                throw new CustomException("Bad border polygon group rim (not unique).");
            }
            this.a = A_0;
            this.b = A_1;
        }

        public IEnumerable<ClassN> MethodB()
        {
            return this.c.Keys;
        }

        public ClassN MethodC()
        {
            return this.a;
        }

        public bool MethodD()
        {
            return this.e;
        }

        public bool Method()
        {
            return this.b;
        }
    }
}

